import React from 'react' 
import { useTranslation } from 'react-i18next';
import Com from '../../hook/Hooks'
import { Button } from 'antd';
function Index() {
  const { t, i18n } = useTranslation();
  const fy = ()=>{
    i18n.changeLanguage(i18n.language=='zh'?'en':'zh')
  }
  return (
    <div>
      <h1>{t('Welcome to React')}</h1>
      <Button onClick={()=>fy()}>翻译</Button>
    </div>
  )
}

export default Com(Index)
